home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / CProspettiveImageGallery.as < prev    next >
Text File  |  2007-11-08  |  4KB  |  140 lines

  1. class CProspettiveImageGallery extends mx.core.UIObject
  2. {
  3.    var mImageCount = 0;
  4.    function CProspettiveImageGallery()
  5.    {
  6.       super();
  7.       this.Hide();
  8.       this.doLater(this,"init");
  9.    }
  10.    function init(Void)
  11.    {
  12.       this.mLoadingQueue = null;
  13.       this.mProspettiva = null;
  14.       this.mImageCount = 0;
  15.       this.mThumbArray = new Array();
  16.       var _loc3_ = 1;
  17.       while(_loc3_ <= 30)
  18.       {
  19.          var _loc4_ = this["mc_img" + String(_loc3_)];
  20.          _loc4_.mId = _loc3_ - 1;
  21.          _loc4_.addEventListener("onThumbEvent",mx.utils.Delegate.create(this,this.onThumbEvent));
  22.          this.mThumbArray.push(_loc4_);
  23.          _loc3_ = _loc3_ + 1;
  24.       }
  25.       this.mc_Dida.__set__html(true);
  26.       this.mc_Dida.embedFonts = _global.gUseEmbeddedFont;
  27.       this.mc_Dida.__set__styleSheet(_global.gStyleManager.GetCSS());
  28.       this.mc_Dida.setStyle("borderStyle","none");
  29.       this.mc_Dida.setVScrollPolicy("off");
  30.    }
  31.    function SwowText(inHtmlText)
  32.    {
  33.       this.mc_Dida.__set__text("<span class=\'s_didaProspettive\'>" + inHtmlText + "</span>");
  34.    }
  35.    function LayoutWindow()
  36.    {
  37.    }
  38.    function ShowGallery(inContributo, inFrom)
  39.    {
  40.       this.SwowText("");
  41.       this.HideAllThumb();
  42.       this.mProspettiva = inContributo;
  43.       this.mImageCount = this.mProspettiva.mNumeroImmagini;
  44.       if(this.mLoadingQueue != null)
  45.       {
  46.          this.mLoadingQueue.stop();
  47.       }
  48.       if(this.mImageCount > 0)
  49.       {
  50.          var _loc3_ = new CLoadingQueue(this);
  51.          _loc3_.addEventListener("onLoadingQueueMessage",mx.utils.Delegate.create(this,this.onLoadingQueueMessage));
  52.          var _loc2_ = 0;
  53.          while(_loc2_ < this.mImageCount)
  54.          {
  55.             _loc3_.addMovie(this.mThumbArray[_loc2_].GetImageTarget(),inContributo.GetImagePath(_loc2_,"thumb"),_loc2_);
  56.             _loc2_ = _loc2_ + 1;
  57.          }
  58.          _loc3_.start();
  59.       }
  60.       this.Show(true);
  61.    }
  62.    function Show(Void)
  63.    {
  64.       this._visible = true;
  65.    }
  66.    function Hide(Void)
  67.    {
  68.       this.HideAllThumb();
  69.       this._visible = false;
  70.    }
  71.    function HideAllThumb()
  72.    {
  73.       var _loc2_ = 0;
  74.       while(_loc2_ < this.mThumbArray.length)
  75.       {
  76.          this.mThumbArray[_loc2_]._visible = false;
  77.          _loc2_ = _loc2_ + 1;
  78.       }
  79.    }
  80.    function Close(Void)
  81.    {
  82.       this.mProspettiva = null;
  83.       this.Hide();
  84.    }
  85.    function onThumbEvent(ev)
  86.    {
  87.       if(ev.eventName == "rollOver")
  88.       {
  89.          if(this.mProspettiva)
  90.          {
  91.             this.SwowText(this.mProspettiva.GetImageDida(ev.eventArg));
  92.          }
  93.       }
  94.       else if(ev.eventName == "rollOut")
  95.       {
  96.          this.SwowText("");
  97.       }
  98.       else if(ev.eventName == "click")
  99.       {
  100.          if(this.mProspettiva && _root.gAppendiceSearch)
  101.          {
  102.             var _loc5_ = this.mProspettiva.GetImageDida(ev.eventArg);
  103.             var _loc4_ = this.mProspettiva.GetImagePath(ev.eventArg,"image");
  104.             this._parent.PauseMovie();
  105.             _root.gAppendiceSearch.ZoomImage(_loc5_,_loc4_);
  106.          }
  107.          this.SwowText("");
  108.       }
  109.    }
  110.    function onLoadingQueueMessage(ev)
  111.    {
  112.       if(ev.eventName == "loaded")
  113.       {
  114.          this.mThumbArray[ev.eventArg]._visible = true;
  115.       }
  116.       else if(ev.eventName == "stopped")
  117.       {
  118.          this.mLoadingQueue = null;
  119.       }
  120.    }
  121.    function setEnabled(enable)
  122.    {
  123.    }
  124.    function ReleaseMemory()
  125.    {
  126.       if(this.mLoadingQueue != null)
  127.       {
  128.          this.mLoadingQueue.stop();
  129.       }
  130.       this.mLoadingQueue = null;
  131.       var _loc2_ = 0;
  132.       while(_loc2_ < this.mThumbArray.length)
  133.       {
  134.          this.mThumbArray[_loc2_].ReleaseMemory();
  135.          _loc2_ = _loc2_ + 1;
  136.       }
  137.       this.HideAllThumb();
  138.    }
  139. }
  140.